package com.cy.controller;

import com.cy.common.entity.Result;
import com.cy.pojo.vo.LoginVo;
import com.cy.service.LoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author : 残影
 * @Date: 2022/4/13
 */
@RestController
@RequestMapping("/system")
@Api(tags = "登录模块")
public class LoginController {
    @Autowired
    private LoginService loginService;

    @ApiOperation("登录")
    @PostMapping("login")
    public Result login(@RequestBody LoginVo userVo){
//        return loginService.getLogin(userVo);
        return Result.ok("登录成功").put("token", "token");
    }

    @ApiOperation("退出")
    @PostMapping("logout")
    public Result logout(HttpServletRequest request){
//        loginService.logout(request);
        return Result.ok("退出成功");
    }

    @ApiOperation("获取用户信息")
    @GetMapping("getUserInfo")
    public Result getUserInfo(HttpServletRequest request){
//        return loginService.getUserInfo(request);
        return Result.ok("获取用户信息成功","info");
    }
}
